Skip to content

gui: replace flat group ComboBox with tree view in PasskeyImportDialog#13337

Open
tredondo wants to merge 1 commit into
keepassxreboot:developfrom
tredondo:fix/passkey-group-tree
Open

gui: replace flat group ComboBox with tree view in PasskeyImportDialog#13337
tredondo wants to merge 1 commit into
keepassxreboot:developfrom
tredondo:fix/passkey-group-tree

Conversation

@tredondo
Copy link
Copy Markdown

@tredondo tredondo commented May 12, 2026

Hi again, and apologies in advance because I have a couple of recent closed PRs (#13317, #13335) where I was wrong on the merits, and I want to be upfront about that history before asking you to spend time on this one. Please feel free to close this just as quickly if it's already been considered, or if I'm again missing something obvious.

This change aims to fix #13336. It replaces the QComboBox group selector in PasskeyImportDialog with a QTreeView backed by a small QSortFilterProxyModel (GroupModelNoRecycle) — the same pattern already used by DatabaseSettingsWidgetFdoSecrets for "Expose entries under this group". For databases with many nested groups, the flat slash-separated list (Root, Root/SaaS, Root/SaaS/AWS, …) can be hard to scan, and I thought it might be worth offering that hierarchical affordance here too. That said, I realize the two contexts are not identical (Secret Service is a config one-shot; the passkey dialog is a live registration flow), and I may be wrong about whether the comparison really holds.

Concretely:

  • PasskeyImportDialog.ui: the Group row's QComboBox is replaced with two QRadioButtons ("Default passkeys group (Imported Passkeys)" and "Select group:") plus a QTreeView that is enabled only when the second radio is chosen. Dialog minimum height bumped from 300 to 420 to leave room for the tree.
  • PasskeyImportDialog.{h,cpp}: nested GroupModelNoRecycle proxy (verbatim pattern from src/fdosecrets/widgets/DatabaseSettingsWidgetFdoSecrets.cpp); recycle bin is filtered out. changeGroup(int) becomes onGroupSelectionChanged() driven by the tree's selection model and the radio toggles. When "Select group" is first checked and nothing is selected, the root is auto-selected so the import button always has a valid destination.

I want to be transparent that this patch was drafted by Claude (Opus 4.7), and I reviewed and tested the result myself. Given my recent track record I'd completely understand reluctance to merge AI-assisted UI changes from me, and I'm not asking for special consideration.

Screenshots

Please see 13336.

Testing strategy

Built locally on Linux (Qt5, commit base 703855b for code-equivalence; tree-view rebased onto current develop at 7c7ca45) with -DKPXC_FEATURE_BROWSER=ON -DKPXC_FEATURE_FDOSECRETS=ON. Verified manually:

  • Default radio is checked on open; tree view disabled; import goes to "Imported Passkeys" as before.
  • Switching to "Select group:" enables the tree and auto-selects the root so the import button is never armed with an invalid destination.
  • Selecting a nested group updates the entry combo box (existing updateEntries flow is preserved).
  • Recycle bin is filtered out (matches DatabaseSettingsWidgetFdoSecrets behaviour).
  • Switching the database resets the tree model cleanly (old selection-model signals disconnected; new model installed; default radio re-checked under a QSignalBlocker to avoid a redundant addEntries()).

I did not add unit tests for the new path. If this direction is acceptable I'm willing to add one to tests/; I held off because I wasn't sure the change would be wanted at all.

Type of change

  • ✅ Refactor (significant modification to existing code)

Thanks for taking a look, and sorry again for the noise on the previous two.

The group selector in the passkey import dialog used a QComboBox populated with flat slash-separated paths (e.g. "Root/SaaS/AWS"). For databases with many groups this list is hard to navigate and is inconsistent with the rest of the UI, where group selection uses a QTreeView.

Replace the ComboBox with two QRadioButtons ("Default passkeys group" / "Select group:") and a QTreeView backed by a GroupModelNoRecycle proxy — the same pattern already used by DatabaseSettingsWidgetFdoSecrets. The recycle-bin group is hidden. When "Select group" is chosen and nothing is selected yet the root is auto-selected so there is always a valid destination. The dialog minimum height is raised to accommodate the tree view.

Relevant files: src/gui/passkeys/PasskeyImportDialog.ui, src/gui/passkeys/PasskeyImportDialog.h, src/gui/passkeys/PasskeyImportDialog.cpp
@tredondo tredondo marked this pull request as ready for review May 12, 2026 22:21
@droidmonkey
Copy link
Copy Markdown
Member

I am excited to test this, thank you!

@varjolintu varjolintu added feature: Passkeys pr: ai-assisted Pull request contains significant contributions by generative AI labels May 13, 2026
@varjolintu varjolintu self-requested a review May 13, 2026 13:13
@varjolintu
Copy link
Copy Markdown
Member

One small thing I noticed. If I have to databases open and I activate the Select group option, and then switch to another database, the Group selection is back at the Default passkey group. For me it would be logical that this option is remembered even if I decide to switch to another database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: Passkeys pr: ai-assisted Pull request contains significant contributions by generative AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Passkey import dialog: replace flat group picklist with easier to navigate tree

3 participants